﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BUS;
using DAO;

namespace FDeal.PH_Admin
{
    public partial class ADmin_Them_DoanhNghiep : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void btThayDoiDoanhNghiep_Click(object sender, EventArgs e)
        {
            ThongTinTaiKhoanBUS ttBUS = new ThongTinTaiKhoanBUS();
            THONGTINTAIKHOAN tttk = new THONGTINTAIKHOAN();
            if (ttBUS.KTname(tbDNTenTaiKhoan.Text))
            {
                tttk.TENDANGNHAP = tbDNTenTaiKhoan.Text;
                tttk.MATKHAU = tbDNMatKhau.Text;

                TaiKhoanDoanhNghiepBUS taiKhoangDoanhNghiepBUS = new TaiKhoanDoanhNghiepBUS();
                TAIKHOANDOANHNGHIEP taiKhoangDoanhNghiep = new TAIKHOANDOANHNGHIEP();
                taiKhoangDoanhNghiep.TENDN = tbTenDoanhNghiep.Text;
                taiKhoangDoanhNghiep.MOTA = tbMoTaDoanhNghiep.Text;
                taiKhoangDoanhNghiep.DIACHI = tbDiaChi.Text;
                taiKhoangDoanhNghiep.SDT = tbSDT.Text;
                taiKhoangDoanhNghiepBUS.Them(taiKhoangDoanhNghiep);
            }
            Response.Redirect("~/PH_Admin/Admin_DoanhNghiep.aspx");
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alertMe();", true);
            //Response.Redirect("~/PH_Admin/Admin_DoanhNghiep.aspx");
        }

        protected void btCanelDoanhNghiep_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/PH_Admin/Admin_DoanhNghiep.aspx");
        }
    }
}